@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

/* Базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    list-style: none;
    text-decoration: none;
}

body {
    background: #fff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: #333;
    position: relative;
}

/* Шапка сайта */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8%;
    height: 70px;
    z-index: 1000;
}

.header-right {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.cart-btn {
    margin-right: 20px;
    padding: 8px 15px;
    background: deeppink;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.cart-btn:hover {
    background: deeppink;
}

.cart-count {
    background: #ff5722;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.logo-img {
    width: 140px;
    height: auto;
}

/* Основное меню */
.menu ul {
    display: flex;
    padding: 0;
    margin: 0;
}

.menu ul li {
    position: relative;
    margin-right: 20px;
}

.menu ul li:last-child {
    margin-right: 0;
}

.menu ul li a {
    display: inline-block;
    font-size: 18px;
    font-weight: 500;
    color: #fff;
    padding: 15px;
    transition: color 0.3s;
}

.menu ul li a:hover {
    color: deeppink;
}

/* Выпадающее меню */
.dropdown-content {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    margin: 0 auto;
    top: 60px;
    background-color: rgba(0, 0, 0, 0.8);
    width: 100%;
    max-width: 1200px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
    z-index: 999;
    padding: 30px;
    border-radius: 0 0 10px 10px;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

.menu ul li:hover .dropdown-content {
    display: grid;
}

.dropdown-column {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dropdown-column a {
    display: block;
    color: #fff;
    padding: 8px 0;
    font-size: 16px;
    transition: color 0.3s;
    text-align: center;
    width: 100%;
}

.dropdown-column a:hover {
    color: deeppink;
    text-decoration: underline;
}

.h {
    color: rgb(238, 0, 91);
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    width: 100%;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Адаптивность меню */
@media (max-width: 1200px) {
    .dropdown-content {
        grid-template-columns: repeat(3, 1fr);
        max-width: 800px;
    }
}

@media (max-width: 768px) {
    .menu-button {
        display: block;
        cursor: pointer;
        font-size: 24px;
        color: white;
        margin-right: 15px;
    }
    
    .menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 80%;
        height: calc(100vh - 80px);
        background: #333;
        transition: left 0.3s;
    }
    
    .menu.active {
        left: 0;
    }
    
    .menu ul {
        flex-direction: column;
    }
    
    .menu ul li {
        width: 100%;
        margin-right: 0;
    }
    
    .dropdown-content {
        position: static;
        display: none;
        width: 100%;
        max-width: 100%;
        box-shadow: none;
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    .link-checkbox:checked ~ .dropdown-content {
        display: grid;
    }
}

/* Карточки товаров */
.product-container {
    display: flex;
    justify-content: center;
    margin: 20px auto 40px;
    padding: 0 20px;
    max-width: 1200px;
}

.card {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    width: 60%;
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
}

.card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.12);
    transform: translateY(-5px);
}

.card-image {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

.card:hover .card-image img {
    transform: scale(1.05);
}

.card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-name {
    font-weight: 700;
    text-align: center;
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.card-price {
    color: #e53935;
    font-weight: bold;
    font-size: 18px;
    text-align: center;
    margin-bottom: 15px;
}

.card-description {
    display: none;
    font-size: 14px;
    color: #555;
    margin-bottom: 20px;
    line-height: 1.6;
}

.card-actions {
    margin-top: auto;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.cart-qty {
    font-size: 14px;
    margin: 10px 0;
    color: #666;
    text-align: center;
}

.add-to-cart-btn {
    width: 100%;
    padding: 12px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.add-to-cart-btn:hover {
    background-color: #218838;
}

.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.quantity-controls button {
    width: 36px;
    height: 36px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.quantity-controls button:hover {
    background-color: #e0e0e0;
}

.qty-display {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
}

/* Раскрытая карточка */
.card.expanded {
    width: 85%;
    height: auto;
    flex-direction: row;
    align-items: flex-start;
    z-index: 100;
}

.card.expanded .card-image {
    width: 40%;
    height: 400px;
}

.card.expanded .main-image {
    display: none;
}

.card.expanded .card-content {
    width: 60%;
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.card.expanded .card-description {
    display: block;
    margin-top: 20px;
}

.card.expanded .card-name {
    text-align: left;
    font-size: 24px;
}

.card.expanded .card-price {
    text-align: left;
    font-size: 22px;
}

.card.expanded .card-actions {
    display: block;
    opacity: 1;
    margin-top: 20px;
}

/* Карусель */
.carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: none;
}

.card.expanded .carousel-container {
    display: block;
}

.carousel-images {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
}

.carousel-images img {
    min-width: 100%;
    object-fit: contain;
    height: 100%;
}

.carousel-prev, .carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.carousel-prev {
    left: 15px;
}

.carousel-next {
    right: 15px;
}

.carousel-container * {
    pointer-events: auto;
}

/* Баннер и описание */
.full-width-image-container {
    position: relative;
    width: 100%;
    overflow: hidden; /* если нужно скрыть выходящие за границы части */
    margin: 70px 0 0;
    padding-top: 0px;
}

.full-width-image {
    width: 100%;
    height: auto; /* сохраняет пропорции */
    display: block;
    object-fit: contain; /* всё изображение видно, без обрезки */
}

.image-description {
    padding: 30px 15%;
    text-align: center;
    background-color: #f8f8f8;
}

.image-description h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 28px;
}

.image-description p {
    color: #555;
    font-size: 16px;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
}

/* Модальное окно корзины */
#cart-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

#cart-modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

#cart-items {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.cart-item {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.cart-item-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-item-name {
    flex: 1;
    font-size: 16px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 15px;
}

.cart-item-qty {
    margin: 0 15px;
    color: #666;
    min-width: 60px;
    text-align: center;
}

.cart-item-price {
    font-weight: bold;
    color: #333;
    min-width: 100px;
    text-align: right;
}

.cart-item-plus, 
.cart-item-minus {
    width: 28px;
    height: 28px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.cart-item-plus:hover, 
.cart-item-minus:hover {
    background: #e0e0e0;
}

.cart-total {
    text-align: right;
    font-size: 20px;
    margin: 25px 0;
    padding-top: 15px;
    border-top: 2px solid #eee;
    font-weight: bold;
}

.modal-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.close-button {
    padding: 12px 24px;
    background: #f0f0f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.checkout-button {
    padding: 12px 24px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.empty-cart {
    text-align: center;
    padding: 30px;
    color: #666;
    font-style: italic;
}

/* Подвал сайта */
.footer {
    background-color: #333;
    color: white;
    padding: 25px;
    margin-top: auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    text-align: center;
}

.footer p {
    color: #fff;
    font-size: 16px;
    margin: 0 20px;
}

.footer a {
    color: #fff;
    font-size: 16px;
    margin: 0 20px;
    transition: color 0.3s;
}

.footer a:hover {
    color: deeppink;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .card {
        width: 70%;
    }
    
    .card.expanded {
        width: 90%;
    }
}

@media (max-width: 768px) {
    .card {
        width: 90%;
    }
    
    .card.expanded {
        width: 95%;
        flex-direction: column;
    }
    
    .card.expanded .card-image {
        width: 100%;
        height: 300px;
    }
    
    .card.expanded .card-content {
        width: 100%;
        padding: 20px;
    }
    
    .carousel-prev, .carousel-next {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .image-description {
        padding: 20px 10%;
    }
    
    .image-description h1 {
        font-size: 24px;
    }
    
    .image-description p {
        font-size: 14px;
    }
}